﻿using System;
using System.Collections.Generic;

using DDDSample.Domain.Model.Handling;
using DDDSample.Domain.Model.Locations;

namespace DDDSample.Domain.Model.Cargos
{
	/// <summary>
	/// For easy testdata creation.
	/// </summary>
	public static class CargoTestHelper
	{
		public static Cargo CreateCargoWithDeliveryHistory(
			TrackingId trackingId, Location origin, Location destination, List<HandlingEvent> events)
		{
			Cargo cargo = new Cargo(trackingId, origin, destination);
			SetDeliveryHistory(cargo, events);

			return cargo;
		}

		public static void SetDeliveryHistory(Cargo cargo, List<HandlingEvent> events)
		{
			cargo.DeliveryHistory = new DeliveryHistory(events);
		}
	}
}
